import axios from 'axios'
import { RESPONSESTATUS } from 'services/constConfig.js'
import * as notifyUtil from 'utils/notifyUtil.js'

// axios.defaults.withCredentials = true

axios.interceptors.response.use(
  function(response) {
    if (response.status === RESPONSESTATUS.SUCCESS) {
      return response
    } else {
      notifyUtil.showNetWorkError(response.data)
      return null
    }
  },
  function(error) {
    console.log(error)
  }
)

export default axios
